package com.example.myweb.Repository.JpaRepository;


import com.example.myweb.Domain.Entity.ContentTopic;
import com.example.myweb.Domain.Entity.Topic;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface ContentTopicRepository extends JpaRepository<ContentTopic, Long> {
    // 可以在这里添加根据contentId和contentType删除关联的方法，用于内容更新
//    List<ContentTopic> findByContentTypeAndContentId(ContentTopic.ContentType contentType, Long contentId);
    Page<ContentTopic> findByTopic(Topic topic, Pageable pageable);
    void deleteByContentTypeAndContentId(ContentTopic.ContentType contentType, Long contentId);
}